package com.leftheart.mapper;

import com.leftheart.entity.Books;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface BooksMapper{
    //增加一本书
    int addBook(Books books);
    //删除一本书
    int deleteBookById(int bookId);
    //更新一本书
    int updateBook(Books books);
    //查询一本书
    Books queryBookById(@Param("bookId") int bookId);
    //查询全部的书
    List<Books> queryAllBook();
//    通过名字查询
    List<Books> queryBookByName(@Param("bookName") String bookName);


}
